<html>
<head>
    @include('v1.common.meta')
    <link rel="stylesheet" href="{{elixir('css/basicdata.css')}}">
</head>
<body>
<div class="yjs-grid">
    <div class="yjs-grid-box">
        <div class="layui-tab">
            @if(Auth::check())
                <div class="layui-container">
                    @if($view==='viewData')
                        {{--查看视图--}}
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <fieldset class="layui-elem-field">
                                    <legend>查看【{{$itemData['name']}}】信息</legend>
                                    <div class="layui-field-box">
                                        <div class="layui-row hidden-tips">
                                            <div class="layui-col-md12">
                                                <blockquote class="layui-elem-quote">
                                                    温馨提示：查看数据时，所有表单项均不可修改。
                                                </blockquote>
                                            </div>
                                        </div>
                                        <div class="layui-form layui-form-pane">
                                            基本信息
                                            <hr class="layui-bg-green">
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">客户代码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['code']}}" disabled
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">客户名称</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['name']}}" disabled
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">签约时间</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['contract_sign_date']}}"
                                                                   disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">服务期限</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['serve_time_limit']}}"
                                                                   disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">创建时间</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['created_at']}}"
                                                                   disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">更新时间</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['updated_at']}}"
                                                                   disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            联系方式
                                            <hr class="layui-bg-blue">
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">手机号码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['mobile']}}"
                                                                   disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">电话号码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['telephone']}}"
                                                                   disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">电子邮件</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['email']}}"
                                                                   disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">传真</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['fax']}}"
                                                                   disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-col-md6">
                                                <div class="layui-form-item">
                                                    <label class="layui-form-label">客户地址</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" value="{{$itemData['address']}}" disabled
                                                               class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </fieldset>
                            </div>
                        </div>
                    @elseif($view=='addData')
                        {{--新增图文视图--}}
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <fieldset class="layui-elem-field">
                                    <legend>新增客户</legend>
                                    <div class="layui-field-box">
                                        {{--<div class="layui-row hidden-tips">--}}
                                            {{--<div class="layui-col-md12">--}}
                                                {{--<blockquote class="layui-elem-quote">--}}
                                                    {{--温馨提示：新增数据时，存在"<i class="layui-icon">&#xe605;</i>"标识的表单项，建议您自主编辑维护；--}}
                                                {{--</blockquote>--}}
                                            {{--</div>--}}
                                        {{--</div>--}}
                                        <div class="layui-form layui-form-pane" name="customersForm"
                                             action="javascript:;" method="POST">
                                            <input type="hidden" name="viewType" value="{{$view}}">
                                            <input type="hidden" name="code" value="{{$randomCode}}">
                                            基本信息
                                            <hr class="layui-bg-green">
                                            {{--<div class="layui-row">--}}
                                                {{--<div class="layui-col-md6">--}}
                                                    {{--<div class="layui-form-item">--}}
                                                        {{--<label class="layui-form-label">客户代码</label>--}}
                                                        {{--<div class="layui-input-inline">--}}
                                                            {{--<input type="text" value="{{$randomCode}}" disabled--}}
                                                                   {{--class="layui-input">--}}
                                                        {{--</div>--}}
                                                    {{--</div>--}}
                                                {{--</div>--}}
                                            {{--</div>--}}
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">客户名称</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="name" required
                                                                   lay-verify="required|name"
                                                                   placeholder="请输入客户名称"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">签约时间</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" class="layui-input" id="signCalendar" readonly
                                                                   name="contract_sign_date" placeholder="请选择时间">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">服务期限</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="serve_time_limit"
                                                                   placeholder="请输入服务期限,单位是年"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">到期提醒时间</label>
                                                        <div class="layui-input-inline">
                                                            <select id="expire_remind_time" name="expire_remind_time"
                                                                    lay-filter="expireRemindTimeSel"
                                                                    lay-search="">
                                                                <option value="">直接选择或搜索选择</option>
                                                                @foreach($expireTimes as $expireTime)
                                                                    <option value="{{$expireTime["code"]}}">{{$expireTime["value"]}}</option>
                                                                @endforeach
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">巡检时间</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" class="layui-input" id="inspectionCalendar" readonly
                                                                   name="inspection_date" placeholder="请选择时间">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">巡检提醒时间</label>
                                                        <div class="layui-input-inline">
                                                            <select id="inspection_remind_time" name="inspection_remind_time"
                                                                    lay-filter="inspectionRemindTimeSel"
                                                                    lay-search="">
                                                                <option value="">直接选择或搜索选择</option>
                                                                @foreach($inspectionTimes as $inspectionTime)
                                                                    <option value="{{$inspectionTime["code"]}}">{{$inspectionTime["value"]}}</option>
                                                                @endforeach
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            联系方式
                                            <hr class="layui-bg-blue">
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">联系人</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="contact"
                                                                   placeholder="请输入联系人姓名" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">手机号码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="mobile"
                                                                   lay-verify="checkMobile"
                                                                   placeholder="请输入手机号码" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">电话号码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="telephone"
                                                                   lay-verify="checkTelephone"
                                                                   placeholder="请输入电话号码" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">电子邮件</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="email"
                                                                   lay-verify="checkEmail"
                                                                   autocomplete="off"
                                                                   placeholder="请输入电子邮件" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">传真</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="fax"
                                                                   placeholder="请输入传真" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">客户地址</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="address"
                                                                   placeholder="请输入客户地址" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md3">
                                                    {{--隐藏提交--}}
                                                    <button id="toolbarSubmit" type="submit" class="layui-btn"
                                                            lay-filter="toolbarEvent" lay-submit style="display: none;">
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </fieldset>
                            </div>
                        </div>
                    @elseif($view=='editData')
                        {{--编辑图文视图--}}
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <fieldset class="layui-elem-field">
                                    <legend>编辑【{{$itemData['name']}}】信息</legend>
                                    <div class="layui-field-box">
                                        {{--<div class="layui-row hidden-tips">--}}
                                        {{--<div class="layui-col-md12">--}}
                                        {{--<blockquote class="layui-elem-quote">--}}
                                        {{--温馨提示：编辑数据时，存在"<i class="layui-icon">&#xe605;</i>"标识的表单项，建议您自主编辑维护；--}}
                                        {{--</blockquote>--}}
                                        {{--</div>--}}
                                        {{--</div>--}}
                                        <div class="layui-form layui-form-pane" name="customersForm"
                                             action="javascript:;" method="POST">
                                            <input type="hidden" name="viewType" value="{{$view}}">
                                            <input type="hidden" name="code" value="{{$itemData['code']}}">
                                            基本信息
                                            <hr class="layui-bg-green">
                                            {{--<div class="layui-row">--}}
                                            {{--<div class="layui-col-md6">--}}
                                            {{--<div class="layui-form-item">--}}
                                            {{--<label class="layui-form-label">客户代码</label>--}}
                                            {{--<div class="layui-input-inline">--}}
                                            {{--<input type="text" value="{{$itemData['code']}}" disabled--}}
                                            {{--class="layui-input">--}}
                                            {{--</div>--}}
                                            {{--</div>--}}
                                            {{--</div>--}}
                                            {{--</div>--}}
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">客户名称</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="name" value="{{$itemData['name']}}" required
                                                                   lay-verify="required|name"
                                                                   placeholder="请输入客户名称"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">签约时间</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" class="layui-input" id="signCalendar" readonly
                                                                   name="contract_sign_date" value="{{$itemData['contract_sign_date']}}" placeholder="请选择时间">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">服务期限</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="serve_time_limit"
                                                                   value="{{$itemData['serve_time_limit']}}"
                                                                   placeholder="请输入服务期限,单位是年"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">到期提醒时间</label>
                                                        <div class="layui-input-inline">
                                                            <select id="expire_remind_time" name="expire_remind_time"
                                                                    lay-filter="expireRemindTimeSel"
                                                                    lay-search="">
                                                                <option value="">直接选择或搜索选择</option>
                                                                @foreach($expireTimes as $expireTime)
                                                                    @if($itemData['expire_remind_time']==$expireTime['code'])
                                                                        <option value="{{$expireTime["code"]}}"
                                                                                selected>{{$expireTime["value"]}}</option>
                                                                    @else
                                                                        <option value="{{$expireTime["code"]}}">{{$expireTime["value"]}}</option>
                                                                    @endif
                                                                @endforeach
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">巡检时间</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" class="layui-input" id="inspectionCalendar" readonly
                                                                   value="{{$itemData['inspection_date']}}"
                                                                   name="inspection_date" placeholder="请选择时间">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">巡检提醒时间</label>
                                                        <div class="layui-input-inline">
                                                            <select id="inspection_remind_time" name="inspection_remind_time"
                                                                    lay-filter="inspectionRemindTimeSel"
                                                                    lay-search="">
                                                                <option value="">直接选择或搜索选择</option>
                                                                @foreach($inspectionTimes as $inspectionTime)
                                                                    @if($itemData['inspection_remind_time']==$inspectionTime['code'])
                                                                        <option value="{{$inspectionTime["code"]}}"
                                                                                selected>{{$inspectionTime["value"]}}</option>
                                                                    @else
                                                                        <option value="{{$inspectionTime["code"]}}">{{$inspectionTime["value"]}}</option>
                                                                    @endif
                                                                @endforeach
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            联系方式
                                            <hr class="layui-bg-blue">
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">联系人</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="contact"
                                                                   value="{{$itemData['contact']}}"
                                                                   placeholder="请输入联系人姓名" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">手机号码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="mobile"
                                                                   value="{{$itemData['mobile']}}"
                                                                   lay-verify="checkMobile"
                                                                   placeholder="请输入手机号码" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">电话号码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="telephone"
                                                                   value="{{$itemData['telephone']}}"
                                                                   lay-verify="checkTelephone"
                                                                   placeholder="请输入电话号码" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">电子邮件</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="email"
                                                                   value="{{$itemData['email']}}"
                                                                   lay-verify="checkEmail"
                                                                   autocomplete="off"
                                                                   placeholder="请输入电子邮件" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">传真</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="fax"
                                                                   value="{{$itemData['fax']}}"
                                                                   placeholder="请输入传真" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">客户地址</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="address"
                                                                   value="{{$itemData['address']}}"
                                                                   placeholder="请输入客户地址" class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md3">
                                                    {{--隐藏提交--}}
                                                    <button id="toolbarSubmit" type="submit" class="layui-btn"
                                                            lay-filter="toolbarEvent" lay-submit style="display: none;">
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </fieldset>
                            </div>
                        </div>
                    @else
                        {{--视图类型不正确--}}
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <blockquote class="layui-elem-quote-error">
                                    友情提示：视图类型不正确，无法支持后续操作。
                                </blockquote>
                            </div>
                        </div>
                    @endif
                </div>
            @else
                <div class="layui-container">
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <blockquote class="layui-elem-quote-error">
                                友情提示：该功能只面向已成功登录系统，并具有相应权限的用户可用。
                            </blockquote>
                        </div>
                    </div>
                </div>
            @endif
        </div>
    </div>
</div>

@include('v1.common.js')
<script src="{{elixir('js/customer_item.js')}}"></script>
</body>
<script type="text/html">
    <input type="hidden" id="rspStatus" value="">
    <input type="hidden" id="rspMsg" value="">
</script>
</html>